{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.先把csv里的数据读取出来\n",
    "\n",
    "这里要注意一点就是，需要sys.path.append添加项目根路径，<br>\n",
    "不然的话，python执行会找不到config和tools这两个自定义<br>\n",
    "模块，而且需要写在import之前！"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests as rq\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import sys\n",
    "import os\n",
    "sys.path.append(os.path.abspath(os.path.join(os.getcwd(), \"../../\")))\n",
    "import config as c\n",
    "import tools as t\n",
    "\n",
    "result_save_file = c.outputs_logs_path + 'wzly.csv'\n",
    "raw_data = pd.read_csv(result_save_file)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.分析身高情况\n",
    "\n",
    "这里要对数据做下清洗，流程如下：\n",
    "\n",
    "- 1.筛选140-200以内的身高值\n",
    "- 2.把身高按照升序排列\n",
    "- 3.按照三个身高段，对数据进行分段处理，依次是140,150,160,170,180"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"8c2cc7eb77824bd49beaf8a73283477f\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_8c2cc7eb77824bd49beaf8a73283477f = echarts.init(document.getElementById('8c2cc7eb77824bd49beaf8a73283477f'), null, {renderer: 'canvas'});\n",
       "var option_8c2cc7eb77824bd49beaf8a73283477f = {\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"position\": null,\n",
       "            \"max\": null,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"axisLabel\": {\n",
       "                \"textStyle\": {\n",
       "                    \"color\": \"#000\",\n",
       "                    \"fontSize\": 12\n",
       "                },\n",
       "                \"margin\": 8,\n",
       "                \"rotate\": 0,\n",
       "                \"interval\": \"auto\"\n",
       "            },\n",
       "            \"name\": \"\",\n",
       "            \"min\": null,\n",
       "            \"type\": \"category\",\n",
       "            \"boundaryGap\": true,\n",
       "            \"data\": [\n",
       "                \"140cm\",\n",
       "                \"150cm\",\n",
       "                \"160cm\",\n",
       "                \"170cm\",\n",
       "                \"180cm\"\n",
       "            ],\n",
       "            \"inverse\": false,\n",
       "            \"nameGap\": 25,\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#fab27b\",\n",
       "        \"#b2d235\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#726930\",\n",
       "        \"#546570\",\n",
       "        \"#c23531\",\n",
       "        \"#918597\",\n",
       "        \"#f47920\",\n",
       "        \"#444693\",\n",
       "        \"#1d953f\",\n",
       "        \"#61a0a8\",\n",
       "        \"#749f83\",\n",
       "        \"#bda29a\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#ca8622\",\n",
       "        \"#d48265\",\n",
       "        \"#f05b72\",\n",
       "        \"#6e7074\",\n",
       "        \"#6950a1\",\n",
       "        \"#905a3d\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#2f4554\",\n",
       "        \"#2a5caa\"\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"trigger\": \"item\",\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\",\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"formatter\": null,\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\"\n",
       "    },\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"position\": null,\n",
       "            \"max\": null,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"axisLabel\": {\n",
       "                \"textStyle\": {\n",
       "                    \"color\": \"#000\",\n",
       "                    \"fontSize\": 12\n",
       "                },\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0\n",
       "            },\n",
       "            \"name\": \"\",\n",
       "            \"min\": null,\n",
       "            \"type\": \"value\",\n",
       "            \"boundaryGap\": true,\n",
       "            \"inverse\": false,\n",
       "            \"nameGap\": 25,\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\\u5206\\u5e03\\u67f1\\u72b6\\u56fe\",\n",
       "            \"subtext\": \"\",\n",
       "            \"left\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#000\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"top\": \"auto\",\n",
       "            \"subtextStyle\": {\n",
       "                \"color\": \"#aaa\",\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#333\",\n",
       "                \"fontSize\": 12\n",
       "            },\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"left\": \"center\",\n",
       "            \"data\": [\n",
       "                \"\\u59b9\\u5b50\\u8eab\\u9ad8\"\n",
       "            ],\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\"\n",
       "    },\n",
       "    \"series_id\": 5643727,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"barCategoryGap\": 0,\n",
       "            \"seriesId\": 5643727,\n",
       "            \"type\": \"bar\",\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"label\": {\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": null,\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#fff\",\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#000\",\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": null\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                13.0,\n",
       "                4045.0,\n",
       "                10568.0,\n",
       "                871.0,\n",
       "                15.0\n",
       "            ],\n",
       "            \"name\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\",\n",
       "            \"stack\": \"\"\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#fff\"\n",
       "};\n",
       "myChart_8c2cc7eb77824bd49beaf8a73283477f.setOption(option_8c2cc7eb77824bd49beaf8a73283477f);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x7fd26827ccf8>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Bar\n",
    "\n",
    "\n",
    "# 身高范围\n",
    "height_interval = ['140cm', '150cm', '160cm', '170cm', '180cm'] \n",
    "\n",
    "# 分析身高\n",
    "def analysis_height(data):\n",
    "    height_data = data['身高']\n",
    "    height = (height_data.loc[(height_data > 140) & (height_data < 200)]).value_counts().sort_index()\n",
    "    height_count = [0, 0, 0, 0, 0]\n",
    "    for h in range(0, len(height)):\n",
    "        if 140 <= height.index[h] < 150:\n",
    "            height_count[0] += height.values[h]\n",
    "        elif 150 <= height.index[h] < 160:\n",
    "            height_count[1] += height.values[h]\n",
    "        elif 160 <= height.index[h] < 170: \n",
    "            height_count[2] += height.values[h]\n",
    "        elif 170 <= height.index[h] < 180:\n",
    "            height_count[3] += height.values[h]\n",
    "        elif 180 <= height.index[h] < 190:\n",
    "            height_count[4] += height.values[h]\n",
    "    return height_count\n",
    "\n",
    "# 绘制身高分布柱状图\n",
    "def draw_height_bar(data):\n",
    "    bar = Bar(\"妹子身高分布柱状图\")\n",
    "    bar.add(\"妹子身高\",height_interval,data,bar_category_gap=0,is_random=True,)\n",
    "    return bar\n",
    "    \n",
    "\n",
    "draw_height_bar(analysis_height(raw_data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"926b5123c1e54077b97c2e5e2fbf9fa9\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_926b5123c1e54077b97c2e5e2fbf9fa9 = echarts.init(document.getElementById('926b5123c1e54077b97c2e5e2fbf9fa9'), null, {renderer: 'canvas'});\n",
       "var option_926b5123c1e54077b97c2e5e2fbf9fa9 = {\n",
       "    \"color\": [\n",
       "        \"#2a5caa\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#444693\",\n",
       "        \"#905a3d\",\n",
       "        \"#f05b72\",\n",
       "        \"#726930\",\n",
       "        \"#d48265\",\n",
       "        \"#b2d235\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#6950a1\",\n",
       "        \"#ca8622\",\n",
       "        \"#918597\",\n",
       "        \"#fab27b\",\n",
       "        \"#1d953f\",\n",
       "        \"#f47920\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#bda29a\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#749f83\",\n",
       "        \"#c23531\",\n",
       "        \"#546570\",\n",
       "        \"#6e7074\"\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"trigger\": \"item\",\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\",\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"formatter\": null,\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\\u5206\\u5e03\\u997c\\u56fe-\\u5706\\u73af\\u56fe\",\n",
       "            \"subtext\": \"\",\n",
       "            \"left\": \"center\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#000\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"top\": \"auto\",\n",
       "            \"subtextStyle\": {\n",
       "                \"color\": \"#aaa\",\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#333\",\n",
       "                \"fontSize\": 12\n",
       "            },\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"left\": \"left\",\n",
       "            \"data\": [\n",
       "                \"140cm\",\n",
       "                \"150cm\",\n",
       "                \"160cm\",\n",
       "                \"170cm\",\n",
       "                \"180cm\"\n",
       "            ],\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\"\n",
       "    },\n",
       "    \"series_id\": 4798939,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"seriesId\": 4798939,\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"type\": \"pie\",\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": null,\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#fff\",\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": null,\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"140cm\",\n",
       "                    \"value\": 13.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"150cm\",\n",
       "                    \"value\": 4045.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"160cm\",\n",
       "                    \"value\": 10568.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"170cm\",\n",
       "                    \"value\": 871.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"180cm\",\n",
       "                    \"value\": 15.0\n",
       "                }\n",
       "            ],\n",
       "            \"name\": \"\",\n",
       "            \"roseType\": null\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#fff\"\n",
       "};\n",
       "myChart_926b5123c1e54077b97c2e5e2fbf9fa9.setOption(option_926b5123c1e54077b97c2e5e2fbf9fa9);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.pie.Pie at 0x7fd294103e48>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Pie\n",
    "\n",
    "\n",
    "# 绘制身高分布饼图\n",
    "def draw_height_pie(data):\n",
    "    pie = Pie(\"妹子身高分布饼图-圆环图\",title_pos='center')\n",
    "    pie.add(\"\", height_interval, data, radius=[40, 75], label_text_color=None,\n",
    "        is_label_show=True, legend_orient='vertical',is_random=True,\n",
    "        legend_pos='left')\n",
    "    return pie\n",
    "\n",
    "draw_height_pie(analysis_height(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**分析时间**：\n",
    "\n",
    "从上面两个图可以看出，占比最高的身高范围是：**160-170cm**，占比达**68.13%**；<br>\n",
    "其次是 **150-160cm**，占比 **26.08%**，170-180cm的占比5.61%，(¯﹃¯)啧啧，<br>\n",
    "像我这种勉强到170cm的应该还是有比较多机会的。\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.分析学历情况\n",
    "\n",
    "接着来分析一波学历情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"f4596b4cd20d4f6c8b1a3063e705ddec\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_f4596b4cd20d4f6c8b1a3063e705ddec = echarts.init(document.getElementById('f4596b4cd20d4f6c8b1a3063e705ddec'), null, {renderer: 'canvas'});\n",
       "var option_f4596b4cd20d4f6c8b1a3063e705ddec = {\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#6950a1\",\n",
       "        \"#2a5caa\",\n",
       "        \"#918597\",\n",
       "        \"#fab27b\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#f47920\",\n",
       "        \"#546570\",\n",
       "        \"#bda29a\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#1d953f\",\n",
       "        \"#749f83\",\n",
       "        \"#b2d235\",\n",
       "        \"#f05b72\",\n",
       "        \"#6e7074\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#726930\",\n",
       "        \"#ca8622\",\n",
       "        \"#444693\",\n",
       "        \"#61a0a8\",\n",
       "        \"#2f4554\",\n",
       "        \"#905a3d\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#d48265\"\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"trigger\": \"item\",\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\",\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"formatter\": null,\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u5b66\\u5386\\u5206\\u5e03\\u6f0f\\u6597\\u56fe\",\n",
       "            \"subtext\": \"\",\n",
       "            \"left\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#000\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"top\": \"center\",\n",
       "            \"subtextStyle\": {\n",
       "                \"color\": \"#aaa\",\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#333\",\n",
       "                \"fontSize\": 12\n",
       "            },\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"left\": \"center\",\n",
       "            \"data\": [\n",
       "                \"\\u9ad8\\u4e2d\",\n",
       "                \"\\u4e2d\\u4e13\",\n",
       "                \"\\u672c\\u79d1\",\n",
       "                \"\\u7855\\u58eb\",\n",
       "                \"\\u9662\\u58eb\",\n",
       "                \"\\u535a\\u58eb\",\n",
       "                \"\\u5927\\u4e13\",\n",
       "                \"\\u521d\\u4e2d\"\n",
       "            ],\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\"\n",
       "    },\n",
       "    \"series_id\": 957331,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"label\": {\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": null,\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#fff\",\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#fff\",\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": null\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u79d1\",\n",
       "                    \"value\": 5902.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u4e13\",\n",
       "                    \"value\": 5213.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ad8\\u4e2d\",\n",
       "                    \"value\": 1538.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u4e13\",\n",
       "                    \"value\": 1338.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u521d\\u4e2d\",\n",
       "                    \"value\": 842.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7855\\u58eb\",\n",
       "                    \"value\": 653.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u535a\\u58eb\",\n",
       "                    \"value\": 30.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9662\\u58eb\",\n",
       "                    \"value\": 4.0\n",
       "                }\n",
       "            ],\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u5b66\\u5386\"\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#fff\"\n",
       "};\n",
       "myChart_f4596b4cd20d4f6c8b1a3063e705ddec.setOption(option_f4596b4cd20d4f6c8b1a3063e705ddec);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.funnel.Funnel at 0x7fd268281668>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Funnel\n",
    "\n",
    "\n",
    "edu_interval = ['本科', '大专', '高中', '中专', '初中', '硕士', '博士', '院士']  # 学历范围\n",
    "\n",
    "# 分析学历\n",
    "def analysis_edu(data):\n",
    "    return data['学历'].value_counts().values\n",
    "\n",
    "\n",
    "# 学历漏斗图\n",
    "def draw_edu_funnel(data):\n",
    "    funnel = Funnel(\"妹子学历分布漏斗图\",title_top='center')\n",
    "    funnel.add(\"学历\", edu_interval, data, is_label_show=True,label_pos=\"inside\", label_text_color=\"#fff\",is_random=True )\n",
    "    return funnel\n",
    "\n",
    "draw_edu_funnel(analysis_edu(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**分析时间**：\n",
    "\n",
    "从上面的漏斗图看出，交友的大部分妹子大部分都是本科与大专的，高中，中专和初中其次，<br>\n",
    "最令我好奇的是竟然有4个院士？？？怀着好奇心我搜了下csv里对应的数据：<br>\n",
    "一个是良缘小秘书，我主良缘官方帐号；<br>接着有两个：<br>\n",
    "http://www.7799520.com/user/616763.html<br>\n",
    "http://www.7799520.com/user/554309.html<br>\n",
    "最后还有一个：<br>\n",
    "http://www.7799520.com/user/418246.html<br>\n",
    "打开一看:<br>\n",
    "![](http://static.zybuluo.com/coder-pig/5czocb1cplikn7achj89xu8d/1.png)\n",
    "然后官网还写着这样的骚话：\n",
    "![](http://static.zybuluo.com/coder-pig/d8ijdz40wg5tr6uk4ul26dzr/2.png)\n",
    "我TM...\n",
    "![](http://static.zybuluo.com/coder-pig/dtdec6xdj1770it2s4axwdmc/3.png)\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.分析年龄情况\n",
    "\n",
    "接着来分析以下都是什么年龄段的妹子找对象(什么年龄段的妹子比较着急...)<br>\n",
    "吐槽下年龄这个，填资料的人不是一般的皮：<br>\n",
    "\n",
    "![](http://static.zybuluo.com/coder-pig/2iqvey783t2a923ea4xgcdx6/1.png)\n",
    "\n",
    "![](http://static.zybuluo.com/coder-pig/3yaev1s475eeo4kwzl61c5oe/2.png)\n",
    "\n",
    "<br>\n",
    "这些垃圾值肯定是要过滤一波的，所有筛选的年龄段范围为：1956-2000，<br>\n",
    "分为五个年龄段：18-25,25-30,31-40,41-50和50以上。<br>\n",
    "接着写代码过滤下统计一波！<br>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': 'https://pyecharts.github.io/jupyter-echarts/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"3a4c758384af462bbf9e3a429ca26bc7\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_3a4c758384af462bbf9e3a429ca26bc7 = echarts.init(document.getElementById('3a4c758384af462bbf9e3a429ca26bc7'), null, {renderer: 'canvas'});\n",
       "var option_3a4c758384af462bbf9e3a429ca26bc7 = {\n",
       "    \"series_id\": 2707165,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"symbol\": \"circle\",\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": null,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0,\n",
       "                \"color\": null\n",
       "            },\n",
       "            \"data\": [\n",
       "                [\n",
       "                    4313.0,\n",
       "                    7355.0,\n",
       "                    3417.0,\n",
       "                    336.0,\n",
       "                    77.0\n",
       "                ]\n",
       "            ],\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": null\n",
       "                }\n",
       "            },\n",
       "            \"type\": \"radar\",\n",
       "            \"label\": {\n",
       "                \"emphasis\": {\n",
       "                    \"position\": null,\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12,\n",
       "                        \"color\": \"#fff\"\n",
       "                    }\n",
       "                },\n",
       "                \"normal\": {\n",
       "                    \"formatter\": null,\n",
       "                    \"position\": \"top\",\n",
       "                    \"show\": false,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12,\n",
       "                        \"color\": \"#000\"\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"name\": \"\\u5e74\\u9f84\\u6bb5\"\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#fff\",\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"left\": \"center\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#333\"\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5e74\\u9f84\\u6bb5\"\n",
       "            ],\n",
       "            \"selectedMode\": \"single\",\n",
       "            \"show\": true,\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\",\n",
       "        \"top\": \"center\",\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#aaa\"\n",
       "            },\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18,\n",
       "                \"color\": \"#000\"\n",
       "            },\n",
       "            \"text\": \"\\u59b9\\u5b50\\u5e74\\u9f84\\u5206\\u5e03\\u96f7\\u8fbe\\u56fe\",\n",
       "            \"subtext\": \"\",\n",
       "            \"top\": \"auto\",\n",
       "            \"left\": \"auto\"\n",
       "        }\n",
       "    ],\n",
       "    \"radar\": {\n",
       "        \"indicator\": [\n",
       "            {\n",
       "                \"max\": 8000,\n",
       "                \"name\": \"18-25\"\n",
       "            },\n",
       "            {\n",
       "                \"max\": 8000,\n",
       "                \"name\": \"26-30\"\n",
       "            },\n",
       "            {\n",
       "                \"max\": 8000,\n",
       "                \"name\": \"31-40\"\n",
       "            },\n",
       "            {\n",
       "                \"max\": 8000,\n",
       "                \"name\": \"41-50\"\n",
       "            },\n",
       "            {\n",
       "                \"max\": 8000,\n",
       "                \"name\": \"50\\u4ee5\\u4e0a\"\n",
       "            }\n",
       "        ],\n",
       "        \"splitArea\": {\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 1,\n",
       "                \"color\": null\n",
       "            },\n",
       "            \"show\": true\n",
       "        },\n",
       "        \"shape\": \"\",\n",
       "        \"axisLine\": {\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": null,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"show\": true\n",
       "        },\n",
       "        \"splitLine\": {\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": null,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"show\": true\n",
       "        },\n",
       "        \"name\": {\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#333\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14,\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"formatter\": null\n",
       "    }\n",
       "};\n",
       "myChart_3a4c758384af462bbf9e3a429ca26bc7.setOption(option_3a4c758384af462bbf9e3a429ca26bc7);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.radar.Radar at 0x7f671dba3160>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Radar\n",
    "\n",
    "\n",
    "# 学历范围\n",
    "age_interval = [\n",
    "    ('18-25', 8000), ('26-30', 8000), ('31-40', 8000),\n",
    "    ('41-50', 8000), ('50以上', 8000),\n",
    "] \n",
    "\n",
    "# 分析年龄\n",
    "def analysis_age(data):\n",
    "    age_data = data['出生年份']\n",
    "    age = (age_data.loc[(age_data >= 1956) & (age_data <= 2000)]).value_counts().sort_index()\n",
    "    age_count = [0, 0, 0, 0, 0]\n",
    "    for h in range(0, len(age)):\n",
    "        if 1993 <= age.index[h] <= 2000:\n",
    "            age_count[0] += age.values[h]\n",
    "        elif 1988 <= age.index[h] <= 1992:\n",
    "            age_count[1] += age.values[h]\n",
    "        elif 1978 <= age.index[h] <= 1987:\n",
    "            age_count[2] += age.values[h]\n",
    "        elif 1968 <= age.index[h] <= 1977:\n",
    "            age_count[3] += age.values[h]\n",
    "        elif age.index[h] < 1968:\n",
    "            age_count[4] += age.values[h]\n",
    "    return age_count\n",
    "\n",
    "# 年龄雷达图\n",
    "def draw_age_radar(data):\n",
    "    radar = Radar(\"妹子年龄分布雷达图\")\n",
    "    radar.config(age_interval)\n",
    "    radar.add(\"年龄段\", data, is_area_show=False,legend_selectedmode='single')\n",
    "    return radar\n",
    "\n",
    "draw_age_radar([analysis_age(raw_data)])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**分析时间**：\n",
    "\n",
    "从雷达图上面可以看出，26-30比较热衷与找对象脱单，人数达到了**7355人**，<br>\n",
    "接着是18-25的，有**4313人**之多，正常，女的都结婚比较早，想想小学同学<br>\n",
    "的儿子都上小学了，我还单着，**哭哭/(ㄒoㄒ)/~~ **。接着是31-40岁的大龄剩女，<br>\n",
    "也有3417人那么多，都是到了年纪才着急么，恐怖...50岁以上的则有77人。\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.分析下城市\n",
    "\n",
    "接下来分析下找对象妹子的城市分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': 'https://pyecharts.github.io/jupyter-echarts/echarts/echarts.min', 'china': 'https://echarts-maps.github.io/echarts-countries-js/echarts-countries-js/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"995e0b85e95143e982ebf2e5eb859909\" style=\"width:1200px;height:600px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'china'], function(echarts) {\n",
       "        \n",
       "var myChart_995e0b85e95143e982ebf2e5eb859909 = echarts.init(document.getElementById('995e0b85e95143e982ebf2e5eb859909'), null, {renderer: 'canvas'});\n",
       "var option_995e0b85e95143e982ebf2e5eb859909 = {\n",
       "    \"series_id\": 4961485,\n",
       "    \"visualMap\": {\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"type\": \"continuous\",\n",
       "        \"calculable\": true,\n",
       "        \"min\": 10,\n",
       "        \"dimension\": null,\n",
       "        \"left\": \"left\",\n",
       "        \"showLabel\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"splitNumber\": 5,\n",
       "        \"max\": 2500,\n",
       "        \"top\": \"bottom\"\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        2469.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5e7f\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.07,\n",
       "                        22.62,\n",
       "                        2372.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6df1\\u5733\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        121.48,\n",
       "                        31.22,\n",
       "                        2319.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u4e0a\\u6d77\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        116.46,\n",
       "                        39.92,\n",
       "                        1231.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5317\\u4eac\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113,\n",
       "                        28.21,\n",
       "                        802.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u957f\\u6c99\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.19,\n",
       "                        30.26,\n",
       "                        751.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u676d\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        118.78,\n",
       "                        32.04,\n",
       "                        655.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5357\\u4eac\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        118.1,\n",
       "                        24.46,\n",
       "                        651.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u53a6\\u95e8\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        119.3,\n",
       "                        26.08,\n",
       "                        611.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u798f\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        104.06,\n",
       "                        30.67,\n",
       "                        532.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6210\\u90fd\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.31,\n",
       "                        30.52,\n",
       "                        425.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6b66\\u6c49\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.33,\n",
       "                        36.07,\n",
       "                        308.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u9752\\u5c9b\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        117,\n",
       "                        36.65,\n",
       "                        230.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6d4e\\u5357\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.62,\n",
       "                        31.32,\n",
       "                        161.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u82cf\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        106.54,\n",
       "                        29.59,\n",
       "                        126.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u91cd\\u5e86\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.75,\n",
       "                        23.04,\n",
       "                        86.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u4e1c\\u839e\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.11,\n",
       "                        23.05,\n",
       "                        86.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u4f5b\\u5c71\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.65,\n",
       "                        34.76,\n",
       "                        55.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u90d1\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        115.12,\n",
       "                        21.23,\n",
       "                        50.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u9999\\u6e2f\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        108.95,\n",
       "                        34.27,\n",
       "                        50.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u897f\\u5b89\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.4,\n",
       "                        23.09,\n",
       "                        40.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u60e0\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        106.71,\n",
       "                        26.57,\n",
       "                        38.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u8d35\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        115.89,\n",
       "                        28.68,\n",
       "                        34.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5357\\u660c\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        117.27,\n",
       "                        31.86,\n",
       "                        32.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5408\\u80a5\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.65,\n",
       "                        28.01,\n",
       "                        31.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6e29\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.52,\n",
       "                        22.3,\n",
       "                        29.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u73e0\\u6d77\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        102.73,\n",
       "                        25.04,\n",
       "                        29.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6606\\u660e\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        118.58,\n",
       "                        24.93,\n",
       "                        28.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6cc9\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        110.88,\n",
       "                        21.68,\n",
       "                        27.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u8302\\u540d\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        110.359377,\n",
       "                        21.270708,\n",
       "                        27.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6e5b\\u6c5f\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        121.56,\n",
       "                        29.86,\n",
       "                        27.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5b81\\u6ce2\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        117.2,\n",
       "                        39.13,\n",
       "                        25.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5929\\u6d25\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        108.33,\n",
       "                        22.84,\n",
       "                        24.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5357\\u5b81\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.38,\n",
       "                        22.52,\n",
       "                        24.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u4e2d\\u5c71\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.48,\n",
       "                        38.03,\n",
       "                        24.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u77f3\\u5bb6\\u5e84\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.29,\n",
       "                        31.59,\n",
       "                        22.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u65e0\\u9521\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        116.35,\n",
       "                        23.55,\n",
       "                        21.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u63ed\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        116.69,\n",
       "                        23.39,\n",
       "                        21.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6c55\\u5934\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.06,\n",
       "                        22.61,\n",
       "                        20.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6c5f\\u95e8\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        123.38,\n",
       "                        41.8,\n",
       "                        19.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6c88\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.01,\n",
       "                        23.7,\n",
       "                        19.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6e05\\u8fdc\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        103.73,\n",
       "                        36.03,\n",
       "                        17.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5170\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.16,\n",
       "                        27.83,\n",
       "                        16.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u682a\\u6d32\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        112.37,\n",
       "                        26.53,\n",
       "                        14.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u8861\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        112.53,\n",
       "                        37.87,\n",
       "                        14.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u592a\\u539f\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        126.63,\n",
       "                        45.75,\n",
       "                        14.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u54c8\\u5c14\\u6ee8\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.09,\n",
       "                        29.37,\n",
       "                        14.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5cb3\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        110.35,\n",
       "                        20.02,\n",
       "                        14.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6d77\\u53e3\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        112.91,\n",
       "                        27.87,\n",
       "                        13.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6e58\\u6f6d\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        121.39,\n",
       "                        37.52,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u70df\\u53f0\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        125.35,\n",
       "                        43.88,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u957f\\u6625\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        119.64,\n",
       "                        29.12,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u91d1\\u534e\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        121.05,\n",
       "                        32.08,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5357\\u901a\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        120.76,\n",
       "                        30.77,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5609\\u5174\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        113.02,\n",
       "                        25.46,\n",
       "                        12.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u90f4\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        117.39,\n",
       "                        24.31,\n",
       "                        11.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6f33\\u5dde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.68,\n",
       "                        23.73,\n",
       "                        11.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u6cb3\\u6e90\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        121.62,\n",
       "                        38.92,\n",
       "                        11.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5927\\u8fde\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        114.87,\n",
       "                        30.45,\n",
       "                        11.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u9ec4\\u5188\"\n",
       "                },\n",
       "                {\n",
       "                    \"value\": [\n",
       "                        111.69,\n",
       "                        29.05,\n",
       "                        11.0\n",
       "                    ],\n",
       "                    \"name\": \"\\u5e38\\u5fb7\"\n",
       "                }\n",
       "            ],\n",
       "            \"symbolSize\": 15,\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\",\n",
       "            \"symbol\": \"circle\",\n",
       "            \"label\": {\n",
       "                \"emphasis\": {\n",
       "                    \"position\": null,\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12,\n",
       "                        \"color\": \"#fff\"\n",
       "                    }\n",
       "                },\n",
       "                \"normal\": {\n",
       "                    \"formatter\": null,\n",
       "                    \"position\": \"top\",\n",
       "                    \"show\": false,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12,\n",
       "                        \"color\": \"#000\"\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"coordinateSystem\": \"geo\"\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#404a59\",\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"left\": \"center\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#333\"\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\",\n",
       "        \"top\": \"center\",\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#aaa\"\n",
       "            },\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18,\n",
       "                \"color\": \"#fff\"\n",
       "            },\n",
       "            \"text\": \"\\u5168\\u56fd\\u59b9\\u5b50\\u6240\\u5728\\u5730\\u5206\\u5e03\",\n",
       "            \"subtext\": \"\\u5236\\u4f5c\\u4eba\\uff1aCoderPIg\",\n",
       "            \"top\": \"auto\",\n",
       "            \"left\": \"left\"\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"roam\": true,\n",
       "        \"map\": \"china\",\n",
       "        \"itemStyle\": {\n",
       "            \"emphasis\": {\n",
       "                \"areaColor\": \"#2a333d\"\n",
       "            },\n",
       "            \"normal\": {\n",
       "                \"borderColor\": \"#111\",\n",
       "                \"areaColor\": \"#323c48\"\n",
       "            }\n",
       "        },\n",
       "        \"label\": {\n",
       "            \"emphasis\": {\n",
       "                \"show\": true,\n",
       "                \"textStyle\": {\n",
       "                    \"color\": \"#eee\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14,\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"formatter\": \"{b}: {c}\"\n",
       "    }\n",
       "};\n",
       "myChart_995e0b85e95143e982ebf2e5eb859909.setOption(option_995e0b85e95143e982ebf2e5eb859909);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.geo.Geo at 0x7f67230a57f0>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Geo\n",
    "\n",
    "\n",
    "# 分析城市分布\n",
    "def analysis_city(data):\n",
    "    city_data = data['城市'].value_counts()\n",
    "    city_list = []\n",
    "    for city in range(0, len(city_data)):\n",
    "        if city_data.values[city] > 10:\n",
    "            city_list.append((city_data.index[city], city_data.values[city]))\n",
    "    return city_list\n",
    "\n",
    "# 城市分布地图\n",
    "def draw_city_geo(data):\n",
    "    geo = Geo(\"全国妹子所在地分布\", \"制作人：CoderPIg\", title_color=\"#fff\",\n",
    "              title_pos=\"left\", width=1200,\n",
    "              height=600, background_color='#404a59')\n",
    "    attr, value = geo.cast(data)\n",
    "    geo.add(\"\", attr, value, visual_range=[10, 2500],  visual_text_color=\"#fff\",\n",
    "            symbol_size=15, is_visualmap=True)\n",
    "    return geo\n",
    "\n",
    "draw_city_geo(analysis_city(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**分析时间:**<br>\n",
    "<br>\n",
    "左侧滑动条是可以滑动的，用于设置人数范围，把low游标往上拉，滚动滚动可缩放<br>\n",
    "![](http://static.zybuluo.com/coder-pig/zzaw5rvfywjpdkxrtlwhby8l/1.png)\n",
    "<br>\n",
    "从下往上依次是(可以把鼠标移到点上查看具体情况)：<br>\n",
    "<br>\n",
    "**广州2469，深圳2372，上海2319，北京1231**<br>\n",
    "<br>\n",
    "low游标往下拉一点，拉到250-1000左右，又有几个新的点出现：<br>\n",
    "<br>\n",
    "**长沙802，杭州751，南京655，厦门651，福州611，成都532，武汉425，青岛308**<br>\n",
    "<br>\n",
    "再拉，99-250左右，有三个新的点：<br>\n",
    "<br>\n",
    "**山东230，苏州161，重庆126**<br>\n",
    "<br>\n",
    "剩下的点比较零碎就不分析了，单身妹子所在地大部分还是集中在北上广深，<br>\n",
    "第二梯队的长沙，杭州，南京，厦门，福州，成都，武汉，青岛..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6. 词频分析\n",
    "\n",
    "接下来分析一波交友宣言，看看妹子们都喜欢怎么样的男生。<br>\n",
    "需要先过滤一波系统默认的交友宣言，一般自己写的都是不会<br>\n",
    "重复的，这个利用pandas.value_counts()，只保留出现一次的<br>\n",
    "交友宣言，然后利用Jieba分词，Counter统计词频，剔除标点和特殊符号，<br>\n",
    "同时过滤掉一些无意义的无用词，取前100个关键词，<br>\n",
    "绘制成词云，以此了解妹子们的喜好。<br>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': 'https://pyecharts.github.io/jupyter-echarts/echarts/echarts.min', 'wordcloud': 'https://pyecharts.github.io/jupyter-echarts/echarts/echarts-wordcloud.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"8f525f13803a460a933ccde448d69016\" style=\"width:900px;height:720px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'wordcloud'], function(echarts) {\n",
       "        \n",
       "var myChart_8f525f13803a460a933ccde448d69016 = echarts.init(document.getElementById('8f525f13803a460a933ccde448d69016'), null, {renderer: 'canvas'});\n",
       "var option_8f525f13803a460a933ccde448d69016 = {\n",
       "    \"series_id\": 3348263,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(108,156,126)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 236,\n",
       "                    \"name\": \"\\u8d23\\u4efb\\u5fc3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(93,111,16)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 191,\n",
       "                    \"name\": \"\\u4e0a\\u8fdb\\u5fc3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(77,97,129)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 99,\n",
       "                    \"name\": \"\\u8fc7\\u65e5\\u5b50\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(40,160,130)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 99,\n",
       "                    \"name\": \"\\u6709\\u7f18\\u4eba\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(7,95,79)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 79,\n",
       "                    \"name\": \"\\u6027\\u683c\\u5f00\\u6717\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(15,61,99)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 74,\n",
       "                    \"name\": \"\\u70ed\\u7231\\u751f\\u6d3b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(6,130,112)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 67,\n",
       "                    \"name\": \"\\u813e\\u6c14\\u597d\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(129,70,23)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 64,\n",
       "                    \"name\": \"\\u7b80\\u7b80\\u5355\\u5355\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(1,154,143)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 60,\n",
       "                    \"name\": \"\\u8d23\\u4efb\\u611f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(11,87,119)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 48,\n",
       "                    \"name\": \"\\u6d3b\\u6cfc\\u5f00\\u6717\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(14,62,2)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 48,\n",
       "                    \"name\": \"\\u6267\\u5b50\\u4e4b\\u624b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(136,146,31)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 47,\n",
       "                    \"name\": \"\\u4e0e\\u5b50\\u5055\\u8001\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(43,146,123)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 46,\n",
       "                    \"name\": \"\\u5b5d\\u987a\\u7236\\u6bcd\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(103,148,158)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 46,\n",
       "                    \"name\": \"\\u4e8b\\u4e1a\\u5fc3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(36,140,32)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 46,\n",
       "                    \"name\": \"\\u5b89\\u5168\\u611f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(4,113,5)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 42,\n",
       "                    \"name\": \"\\u5e73\\u5e73\\u6de1\\u6de1\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(40,17,22)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 40,\n",
       "                    \"name\": \"\\u5fd7\\u540c\\u9053\\u5408\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(40,73,63)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 39,\n",
       "                    \"name\": \"\\u5b81\\u7f3a\\u6bcb\\u6ee5\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(96,127,135)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 37,\n",
       "                    \"name\": \"\\u76f8\\u6fe1\\u4ee5\\u6cab\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(142,91,132)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 36,\n",
       "                    \"name\": \"\\u5584\\u89e3\\u4eba\\u610f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(106,37,24)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 33,\n",
       "                    \"name\": \"\\u7ec6\\u6c34\\u957f\\u6d41\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(145,95,152)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 32,\n",
       "                    \"name\": \"\\u6652\\u592a\\u9633\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(61,43,74)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 32,\n",
       "                    \"name\": \"\\u7fbd\\u6bdb\\u7403\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(105,45,124)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 31,\n",
       "                    \"name\": \"\\u4ef7\\u503c\\u89c2\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(128,40,18)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 29,\n",
       "                    \"name\": \"\\u6e29\\u67d4\\u4f53\\u8d34\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(69,127,2)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 27,\n",
       "                    \"name\": \"\\u79ef\\u6781\\u5411\\u4e0a\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(23,72,104)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 27,\n",
       "                    \"name\": \"\\u62e9\\u4e00\\u57ce\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(115,39,154)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 25,\n",
       "                    \"name\": \"\\u987a\\u5176\\u81ea\\u7136\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(16,92,36)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 25,\n",
       "                    \"name\": \"\\u5171\\u540c\\u8bed\\u8a00\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(111,8,21)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 25,\n",
       "                    \"name\": \"\\u70ed\\u6c14\\u817e\\u817e\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(133,64,42)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 24,\n",
       "                    \"name\": \"\\u672c\\u5730\\u4eba\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(147,160,91)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 24,\n",
       "                    \"name\": \"\\u5b5d\\u656c\\u7236\\u6bcd\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(127,27,13)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 23,\n",
       "                    \"name\": \"\\u7ecf\\u6d4e\\u57fa\\u7840\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(130,28,131)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 23,\n",
       "                    \"name\": \"\\u5408\\u5f97\\u6765\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(115,126,102)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 22,\n",
       "                    \"name\": \"\\u8eab\\u4f53\\u5065\\u5eb7\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(145,139,41)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 22,\n",
       "                    \"name\": \"\\u767d\\u5934\\u5055\\u8001\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(5,24,42)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 20,\n",
       "                    \"name\": \"\\u4e92\\u76f8\\u7406\\u89e3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(71,140,66)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 19,\n",
       "                    \"name\": \"\\u672c\\u79d1\\u6bd5\\u4e1a\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(54,79,84)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 19,\n",
       "                    \"name\": \"\\u76f8\\u4e92\\u7406\\u89e3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(105,77,156)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 19,\n",
       "                    \"name\": \"\\u8e0f\\u8e0f\\u5b9e\\u5b9e\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(89,45,102)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 19,\n",
       "                    \"name\": \"\\u8f70\\u8f70\\u70c8\\u70c8\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(117,158,19)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 18,\n",
       "                    \"name\": \"\\u5305\\u5bb9\\u5fc3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(75,15,156)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 18,\n",
       "                    \"name\": \"\\u5fd7\\u8da3\\u76f8\\u6295\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(63,84,0)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 17,\n",
       "                    \"name\": \"\\u5171\\u540c\\u8bdd\\u9898\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(0,155,36)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 17,\n",
       "                    \"name\": \"\\u771f\\u5fc3\\u5b9e\\u610f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(22,41,24)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 17,\n",
       "                    \"name\": \"\\u4e00\\u89c1\\u949f\\u60c5\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(52,139,13)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 16,\n",
       "                    \"name\": \"\\u5fc3\\u5730\\u5584\\u826f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(127,14,133)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 16,\n",
       "                    \"name\": \"\\u4e00\\u751f\\u4e00\\u4e16\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(113,47,108)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 16,\n",
       "                    \"name\": \"\\u5e7d\\u9ed8\\u611f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(146,142,100)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 15,\n",
       "                    \"name\": \"\\u6709\\u7f18\\u5343\\u91cc\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(156,132,139)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 15,\n",
       "                    \"name\": \"\\u968f\\u9047\\u800c\\u5b89\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(83,143,48)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 15,\n",
       "                    \"name\": \"\\u547d\\u4e2d\\u6ce8\\u5b9a\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(143,18,121)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 14,\n",
       "                    \"name\": \"\\u6162\\u70ed\\u578b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(47,111,16)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 14,\n",
       "                    \"name\": \"\\u5c0f\\u65e5\\u5b50\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(142,138,109)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 14,\n",
       "                    \"name\": \"\\u5f00\\u5f00\\u5fc3\\u5fc3\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(144,92,71)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 14,\n",
       "                    \"name\": \"\\u4e94\\u5b98\\u7aef\\u6b63\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(7,154,14)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 14,\n",
       "                    \"name\": \"\\u771f\\u5fc3\\u771f\\u610f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(52,53,119)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 13,\n",
       "                    \"name\": \"\\u4e0b\\u534a\\u751f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(24,41,50)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 13,\n",
       "                    \"name\": \"\\u65e0\\u6240\\u8c13\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(124,38,62)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 13,\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\\u7701\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(56,154,108)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 13,\n",
       "                    \"name\": \"\\u706f\\u706b\\u9611\\u73ca\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(14,10,5)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u6709\\u610f\\u601d\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(78,51,30)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u7ed3\\u5a5a\\u7684\\u4eba\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(8,137,55)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u901a\\u60c5\\u8fbe\\u7406\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(96,104,16)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u771f\\u8bda\\u76f8\\u5f85\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(93,94,111)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u5de8\\u87f9\\u5ea7\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(111,120,134)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u8ba4\\u8ba4\\u771f\\u771f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(72,132,106)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u5927\\u7537\\u5b50\\u4e3b\\u4e49\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(119,127,4)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 12,\n",
       "                    \"name\": \"\\u5171\\u540c\\u7231\\u597d\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(79,91,2)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u767d\\u7f8a\\u5ea7\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(51,29,49)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u65e5\\u51fa\\u65e5\\u843d\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(148,15,156)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u672c\\u79d1\\u5b66\\u5386\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(43,140,16)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u6709\\u8f66\\u6709\\u623f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(64,92,124)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u84e6\\u7136\\u56de\\u9996\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(7,97,66)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u5c0f\\u4f19\\u4f34\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(154,56,105)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u5171\\u540c\\u8fdb\\u6b65\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(110,70,14)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u5927\\u5b66\\u6bd5\\u4e1a\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(44,107,55)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u8ba4\\u771f\\u5bf9\\u5f85\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(63,14,29)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u95e8\\u5f53\\u6237\\u5bf9\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(76,135,39)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u6027\\u683c\\u5916\\u5411\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(144,108,30)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u72ec\\u7acb\\u81ea\\u4e3b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(80,20,30)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u5343\\u7bc7\\u4e00\\u5f8b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(56,88,65)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 11,\n",
       "                    \"name\": \"\\u6c34\\u74f6\\u5ea7\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(41,78,53)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u751f\\u6d3b\\u4e60\\u60ef\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(29,16,16)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u5c0f\\u670b\\u53cb\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(55,145,32)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u4e00\\u5207\\u90fd\\u662f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(65,101,15)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u4e00\\u5fc3\\u4e00\\u610f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(71,3,99)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u800d\\u6d41\\u6c13\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(4,122,82)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u78b0\\u78b0\\u8fd0\\u6c14\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(127,94,96)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u8bbe\\u8ba1\\u5e08\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(69,44,76)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u624b\\u7275\\u624b\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(97,98,94)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u5de5\\u7a0b\\u5e08\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(106,81,111)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u7814\\u7a76\\u751f\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(90,155,110)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u5904\\u5973\\u5ea7\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(135,151,112)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u767d\\u5934\\u5230\\u8001\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(12,15,72)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u76f8\\u4eb2\\u76f8\\u7231\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(74,15,71)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u770b\\u770b\\u4e66\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(56,44,29)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u767d\\u9a6c\\u738b\\u5b50\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(130,54,76)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u5c0f\\u5973\\u5b50\"\n",
       "                },\n",
       "                {\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(1,63,82)\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"value\": 10,\n",
       "                    \"name\": \"\\u5c0f\\u5b69\\u5b50\"\n",
       "                }\n",
       "            ],\n",
       "            \"rotationStep\": 45,\n",
       "            \"rotationRange\": [\n",
       "                0,\n",
       "                0\n",
       "            ],\n",
       "            \"girdSize\": 20,\n",
       "            \"sizeRange\": [\n",
       "                20,\n",
       "                100\n",
       "            ],\n",
       "            \"shape\": \"diamond\",\n",
       "            \"type\": \"wordCloud\",\n",
       "            \"name\": \"\"\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#fff\",\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"left\": \"center\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#333\"\n",
       "            },\n",
       "            \"data\": [],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"top\": \"top\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        },\n",
       "        \"orient\": \"vertical\",\n",
       "        \"top\": \"center\",\n",
       "        \"show\": true,\n",
       "        \"left\": \"95%\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12,\n",
       "                \"color\": \"#aaa\"\n",
       "            },\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18,\n",
       "                \"color\": \"#000\"\n",
       "            },\n",
       "            \"text\": \"\",\n",
       "            \"subtext\": \"\",\n",
       "            \"top\": \"auto\",\n",
       "            \"left\": \"auto\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14,\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderWidth\": 0,\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"formatter\": null\n",
       "    }\n",
       "};\n",
       "myChart_8f525f13803a460a933ccde448d69016.setOption(option_8f525f13803a460a933ccde448d69016);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.wordcloud.WordCloud at 0x7f672400dd30>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import WordCloud\n",
    "import re\n",
    "import jieba as jb\n",
    "from collections import Counter\n",
    "\n",
    "\n",
    "# 过滤标点符号正则\n",
    "word_pattern = re.compile('[\\s+\\.\\!\\/_,$%^*(+\\\"\\']+|[+——！，。？“”、~@#￥%……&*（）(\\d+)]+')\n",
    "# 过滤无用词\n",
    "exclude_words = [\n",
    "            '一辈子', '不相离', '另一半', '业余时间', '性格特点', '茫茫人海', '男朋友', '找对象',\n",
    "            '谈恋爱', '有时候', '女孩子', '哈哈哈', '加微信', '兴趣爱好',\n",
    "            '是因为', '不良嗜好', '男孩子', '为什么', '没关系', '不介意',\n",
    "            '没什么', '交朋友', '大大咧咧', '大富大贵', '联系方式', '打招呼',\n",
    "            '有意者', '晚一点', '哈哈哈', '以上学历', '是不是', '给我发',\n",
    "            '不怎么', '第一次', '越来越', '遇一人', '择一人', '无数次',\n",
    "            '符合条件', '什么样', '全世界', '比较简单', '浪费时间', '不知不觉',\n",
    "            '有没有', '寻寻觅觅', '自我介绍', '请勿打扰', '差不多', '不在乎', '看起来',\n",
    "            '一点点', '陪你到', '这么久', '看清楚', '身高体重', '比较慢', '比较忙',\n",
    "            '多一点', '小女生', '土生土长', '发消息', '最合适'\n",
    "        ]\n",
    "\n",
    "# 词频分布\n",
    "def analysis_word(data):\n",
    "    word_data = data['交友宣言'].value_counts()\n",
    "    word_list = []\n",
    "    for word in range(0, len(word_data)):\n",
    "        if word_data.values[word] == 1:\n",
    "            word_list.append(word_data.index[word])\n",
    "    return word_list\n",
    "\n",
    "# 交友宣言词云\n",
    "def draw_word_wc(name, count):\n",
    "    wc = WordCloud(width=900, height=720)\n",
    "    wc.add(\"\", name, count, word_size_range=[20, 100], shape='diamond')\n",
    "    return wc\n",
    "\n",
    "word_result = word_pattern.sub(\"\", ''.join(analysis_word(raw_data)))\n",
    "# Jieba分词\n",
    "words = [word for word in jb.cut(word_result, cut_all=False) if len(word) >= 3]\n",
    "# 遍历过滤无用词\n",
    "for i in range(0, len(words)):\n",
    "    if words[i] in exclude_words:\n",
    "        words[i] = None\n",
    "filter_list = list(filter(lambda t: t is not None, words))\n",
    "data = r' '.join(filter_list)\n",
    "# 词频统计\n",
    "c = Counter(filter_list)\n",
    "word_name = []  # 词\n",
    "word_count = []  # 词频\n",
    "for word_freq in c.most_common(100):\n",
    "    word, freq = word_freq\n",
    "    word_name.append(word)\n",
    "    word_count.append(freq)\n",
    "draw_word_wc(word_name, word_count)    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**分析时间：**<br>\n",
    "<br>\n",
    "排名前八的关键词：**责任心，上进心，事业心，热爱生活，性格开朗，脾气好，孝顺父母，安全感**<br>\n",
    "除此之外，我觉得两个人在一起更重要的是**三观差不多，包容心，相互理解**，以及**基本的**<br>\n",
    "**经济基础**吧，毕竟贫贱夫妻百事哀，每天都在为油盐酱醋奔波，天天操心一些鸡毛蒜皮的事，<br>\n",
    "何来的快乐？<br>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
